package com.ss.android.lockscreen.activity.lock.b;

import android.content.Context;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.ss.android.lockscreen.activity.lock.b.a.a;
import com.ss.android.lockscreen.bb;
import com.ss.android.lockscreen.http.data.ScreenCell;

import org.json.JSONException;
import org.json.JSONObject;

import inline.TextDemo;

public class i implements a {
    public View a;
    private View b;
    private View c;
    private ImageView d;
    private View e;
    private TextView f;
    private View g;
    private View h;
    private Context i;
    private com.ss.android.lockscreen.activity.lock.w.a j;

    public i() {

    }

    static com.ss.android.lockscreen.activity.lock.w.a a(i arg1) {
        return arg1.j;
    }

    static void a(i arg4, ScreenCell arg5) {
        if(arg5 != null) {
            JSONObject v0 = new JSONObject();
            try {
                v0.put("itemId", arg5.g);
            }
            catch(Exception v0_1) {
                v0_1.printStackTrace();
            }

            if(arg4.b == null) {
                return;
            }

            if(bb.a().f == null) {
                return;
            }

            JSONObject v1 = new JSONObject();
            try {
                v1.put("group_id", String.valueOf(arg5.f));
                v1.put("item_id", String.valueOf(arg5.g));
                String v2 = "group_type";
                String v0_3 = arg5.i ? "video" : "article";
                v1.put(v2, v0_3);
            }
            catch(JSONException v0_2) {
                v0_2.printStackTrace();
            }

            android.support.design.a.onEvent("lockscreen_dislike", v1);
        }
    }

    public final View a() {
        return this.b;
    }

    public final View a(@NonNull LayoutInflater arg3, @NonNull ViewGroup arg4, @NonNull Context arg5) {
        this.b = arg3.inflate(com.ss.android.article.browser.R.layout.f9, arg4, false);
        this.c = this.b.findViewById(com.ss.android.article.browser.R.id.yg);
        this.d = this.b.findViewById(com.ss.android.article.browser.R.id.yh);
        this.f = this.b.findViewById(com.ss.android.article.browser.R.id.title);
        this.e = this.b.findViewById(com.ss.android.article.browser.R.id.yi);
        this.g = this.b.findViewById(com.ss.android.article.browser.R.id.yj);
        this.h = this.b.findViewById(com.ss.android.article.browser.R.id.yk);
        this.a = this.b.findViewById(com.ss.android.article.browser.R.id.yl);
        this.i = arg5;
        return this.b;
    }

    public final void a(com.ss.android.lockscreen.activity.lock.w.a arg1) {
        this.j = arg1;
    }

    public final void a(Object arg4) {
        float v2 = 1f;
        if(arg4 != null) {
            this.f.setText(((ScreenCell)arg4).c);
            this.c.setOnClickListener(new j(this, ((ScreenCell)arg4)));
            this.c.setAlpha(v2);
            this.c.setScaleX(v2);
            this.c.setScaleY(v2);
            k v0 = new k(this, ((ScreenCell)arg4));
            this.g.setOnClickListener(((View.OnClickListener)v0));
            this.h.setOnClickListener(((View.OnClickListener)v0));
            if(!TextDemo.c(((ScreenCell)arg4).h) && bb.a().e != null) {
                com.ss.android.lockscreen.e.d.a(this.d.getContext(), this.d, ((ScreenCell)arg4).h);
            }

            View v1 = this.e;
            int v0_1 = ((ScreenCell)arg4).i ? 0 : 8;
            com.ss.android.lockscreen.utils.c.a(v1, v0_1);
        }
    }

    static View b(i arg1) {
        return arg1.c;
    }

    static void b(i arg1, ScreenCell arg2) {
        if(arg2 != null && arg1.i != null) {
            com.ss.android.lockscreen.a.a.a(arg1.i, arg2);
        }
    }
}

